package com.df.my_net_game.game_rpc.client.lb.impl;

import com.df.my_net_game.game_rpc.ServerNode;
import com.df.my_net_game.game_rpc.client.lb.LBStrategy;

import java.util.List;

public class LastFirstLBStrategy implements LBStrategy {
    ServerNode serverNode;
    @Override
    public ServerNode select(List<ServerNode> serverNodes) {
        if(serverNode!=null && serverNodes.contains(serverNode)){
            return serverNode;
        }

        return serverNodes.get(0);
    }
}
